//my-tabbar文件
<template>
	<view>
		<u-tabbar :value="currentTab" :fixed="true" :border="false" activeColor="#2C3746FF" :placeholder="false"
			@change="changeTabIndex" class="tabbar-box">
			<!-- 		<u-tabbar-item v-for="item in switchTabs" :key="item.name" :text="item.text" :icon="item.iconName"> -->
			<u-tabbar-item v-for="item in switchTabs" :key="item.name" :text="item.text">
				<image :style="{width:item.width,height:item.height}" slot='active-icon' :src="item.selectedIconPath">
				</image>
				<image slot='inactive-icon' :style="{width:item.width,height:item.height}" :src="item.iconPath"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				switchTabs: [{
						"pagePath": "/pages/index/index",
						"iconName": "/static/images/user.png",
						"text": "首页",
						"name": "home",
						"selectedIconPath": "/static/images/v2/tabbar/home_.png",
						"iconPath": "/static/images/v2/tabbar/home.png",
						"width": "50rpx",
						"height": "56rpx"
					},
					{
						"pagePath": "/pages/invite/index",
						"iconName": "home",
						"text": "邀约",
						"name": "home",
						"selectedIconPath": "/static/images/v2/tabbar/yaoyue_.png",
						"iconPath": "/static/images/v2/tabbar/yaoyue.png",
						"width": "50rpx",
						"height": "56rpx"
					},
					{
						"pagePath": "/pages/make/index",
						"iconName": "home",
						"text": "预约",
						"name": "home",
						"selectedIconPath": "/static/images/v2/tabbar/yuyue_.png",
						"iconPath": "/static/images/v2/tabbar/yuyue.png",
						"width": "50rpx",
						"height": "56rpx"
					},
					{
						"pagePath": "/pages/browse/index",
						"iconName": "home",
						"text": "浏览",
						"name": "home",
						"selectedIconPath": "/static/images/v2/tabbar/liulan_.png",
						"iconPath": "/static/images/v2/tabbar/liulan.png",
						"width": "50rpx",
						"height": "56rpx"
					},
					
					{
						"pagePath": "/pages/mine/index",
						"iconName": "account",
						"text": "我的",
						"name": "mine",
						"selectedIconPath": "/static/images/v2/tabbar/my_.png",
						"iconPath": "/static/images/v2/tabbar/my.png",
						"width": "50rpx",
						"height": "56rpx"
					},

				]
			}
		},
		props: ['currentTab'],
		methods: {
			changeTabIndex(e) {
				let pagePath = this.switchTabs[e].pagePath
				uni.switchTab({
					url: pagePath
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.tabbar-box {
		padding-top: 40rpx;
	}

	.bar_img {
		width: 56rpx;
		height: 56rpx;
	}
</style>